home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / sysdeps / alpha / remq.S < prev    next >
Text File  |  1993-12-22  |  869b  |  55 lines

  1.       /* This file is generated from divrem.m4; DO NOT EDIT! */
  2. /* For each N divided by D, we do:
  3.       result = (double) N / (double) D
  4.    Then, for each N mod D, we do:
  5.       result = N - (D * divMODE (N, D))
  6.  
  7.    FIXME:
  8.    The q and qu versions won't deal with operands > 50 bits.  We also
  9.    don't check for divide by zero.  */
  10.  
  11. #include "DEFS.h"
  12. #if 0
  13. /* We do not handle div by zero yet.  */
  14. #include <machine/pal.h>
  15. #endif
  16. #include <regdef.h>
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. FUNC__(remq)
  24.     ! First set up the dividend.
  25.     
  26.     stq t10,0(sp)
  27.     ldt $f10,0(sp)
  28.     cvtqt $f10,$f10
  29.     
  30.  
  31.     ! Then set up the divisor.
  32.     
  33.     stq t11,0(sp)
  34.     ldt $f1,0(sp)
  35.     cvtqt $f1,$f1
  36.     
  37.  
  38.     ! Do the division.
  39.     divt $f10,$f1,$f10
  40.     cvttqc $f10,$f10
  41.  
  42.     ! Put the result in t12.
  43.     stt $f10,0(sp)
  44.     ldq t12,0(sp)
  45.     
  46.  
  47.         ! Compute the remainder.
  48.     mulq t11, t12, t11
  49.     subq t10, t11, t12
  50.  
  51.  
  52.     lda sp,16(sp)
  53.     ret zero,(t9),1
  54.     .end NAME__(remq)
  55.